package pl.register.android.rating;

import pl.register.android.R;

/**
 * @author Mateusz Strzelecki
 * @since 2013-04-14
 */

public enum Rating {
    /**
     * 0 none
     * 1 fail
     * 2 poor
     * 3 satisfactory
     * 4 good
     * 5 very good
     * 6 excellent
     */

    NONE(0) {
        @Override
        public int getStarResId() {
            return R.drawable.rate_star_transparent;
        }

        @Override
        public Rating getNext() {
            return FAIL;
        }
    }, FAIL(1) {
        @Override
        public int getStarResId() {
            return R.drawable.rate_star_off_light;
        }

        @Override
        public Rating getNext() {
            return SATISFACTORY;
        }
    }, SATISFACTORY(3) {
        @Override
        public int getStarResId() {
            return R.drawable.rate_star_half_light;
        }

        @Override
        public Rating getNext() {
            return VERY_GOOD;
        }
    }, VERY_GOOD(5) {
        @Override
        public int getStarResId() {
            return R.drawable.rate_star_on_light;
        }

        @Override
        public Rating getNext() {
            return NONE;
        }
    };

    public abstract int getStarResId();

    public abstract Rating getNext();


    private int value;

    private Rating(int value) {
        this.value = value;
    }
}
